package pattern.observer;

public class Observer2 implements Observer{

    private Subject subject;

    public Observer2(Subject subject){
        this.subject=subject;
        this.subject.addObserver(this);
    }
    @Override
    public void update(String info) {
        System.out.println("观察者2得到的消息："+info);
    }
}
